Termination w.r.t. Q of the following Term Rewriting System could be proven:
Q restricted rewrite system:
The TRS R consists of the following rules:
prime(0) → false
prime(s(0)) → false
prime(s(s(x))) → prime1(s(s(x)), s(x))
prime1(x, 0) → false
prime1(x, s(0)) → true
prime1(x, s(s(y))) → and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) → =(rem(x, y), 0)
Q is empty.
↳ QTRS
↳ DirectTerminationProof
Q restricted rewrite system:
The TRS R consists of the following rules:
prime(0) → false
prime(s(0)) → false
prime(s(s(x))) → prime1(s(s(x)), s(x))
prime1(x, 0) → false
prime1(x, s(0)) → true
prime1(x, s(s(y))) → and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) → =(rem(x, y), 0)
Q is empty.
We use [23] with the following order to prove termination.
Recursive path order with status [2].
Quasi-Precedence:
[prime1, prime12] > false > [0, s1, true, and2, =2]
[prime1, prime12] > not1 > [0, s1, true, and2, =2]
[prime1, prime12] > divp2 > rem2 > [0, s1, true, and2, =2]
Status: true: multiset
rem2: multiset
prime1: [1]
and2: multiset
false: multiset
divp2: multiset
0: multiset
s1: multiset
=2: [2,1]
prime12: [2,1]
not1: multiset